﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="MAS_EduInstitutes.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.MAS_EduInstitutes" %>
<%@ Register src="../Controls/user.ascx" tagname="user" tagprefix="uc1" %>
<asp:Content 
    ID="Content1" 
    runat="server" 
    contentplaceholderid="ContentPlaceHolder1">
    <title>ข้อมูลสถาบันการศึกษา</title>
    <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" />
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">        
            <script type="text/javascript">
                function onTextChange(sender) {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
                }
                function isNumberKey(event)  // ตัวเลขอย่างเดียว
                {
                    var charCode = (event.which) ? event.which : event.keyCode
                    if (charCode > 31 && (charCode < 48 || charCode > 57)) {
                        alert("กรุณากรอกเฉพาะตัวเลข!!")
                        return false;
                    }
                    return true;
                }
                                
            </script>       
    </telerik:RadCodeBlock>

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="cmdSearch">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTreeView1" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="cmdExpand">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTreeView1"
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="cmdCollapse">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTreeView1" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadTreeView1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lblUpperText" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" 
        Height="100%" Width="75px" Transparency="50">
        <table style="height: 100%; width: 100%" border="0">
            <tr>
                <td width="100%" align="center" valign="middle">
                    <img alt="Loading..." 
                        src="../Images/Buttons/loading.gif" 
                        style="border: 0px;" />
                </td>
            </tr>
        </table>
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server">
    </telerik:RadAjaxLoadingPanel>
<table>
<tr>
<td>
    <!-- <uc1:user ID="user1" runat="server" /> -->
</td>
<td width="20" >
</td>


<td>
</td>
</tr>

<tr>
<td colspan = "3">

    <div class="Background980V2" style="width: 975px; padding: 10px 10px 10px 10px;">

    <table align="center" width ="100%" >
    <tr>
        <td align="left" class="tableHeader">
            ข้อมูลสถาบันการศึกษา</td>
    </tr>
    </table>
    <table align="center" width ="100%" >
    <tr>
    <td >
    <asp:Panel ID="PanelTree" 
        runat="server" Width="100%" 
        ScrollBars="Auto">
        <telerik:RadGrid 
            ID="RadGrid1" 
            runat="server" 
            AllowAutomaticDeletes="True" 
            AllowFilteringByColumn="True" 
            AllowMultiRowEdit="True" 
            AllowMultiRowSelection="True" 
            AllowPaging="True" 
            AllowSorting="True" 
            AutoGenerateColumns="False" 
            EnableAJAX="True" 
            EnableAJAXLoadingTemplate="True" 
            GridLines="None" 
            OnItemCommand="RadGrid1_ItemCommand" 
            Skin="Outlook" 
            Width="967px">
            <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" 
                ClientDataKeyNames="EDU_INS_SEQ" 
                CommandItemDisplay="Top" 
                DataKeyNames="EDU_INS_SEQ" 
                InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                <CommandItemTemplate>
                    <table width="100%">
                        <tr>
                            <td>
                                <asp:LinkButton ID="cmdAddNew" runat="server" CausesValidation="False" 
                                    CommandName="InitInsert"                                                   
                                    Visible="<%# !RadGrid1.MasterTableView.IsItemInserted && RadGrid1.EditIndexes.Count <= 0 %>">
                        <img style="border:0px;vertical-align:middle;" alt="" 
                        src="../Images/Buttons/AddRecord.gif" /> เพิ่มข้อมูลสถาบันการศึกษา</asp:LinkButton>
                               </td>
    
                        </tr>
                    </table>
                </CommandItemTemplate>
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px" />
                </ExpandCollapseColumn>
                
                <Columns>
                    <telerik:GridEditCommandColumn 
                        EditText = "คลิกเพื่อแก้ไขรายการ"
                        ButtonType="ImageButton">
                         <HeaderStyle HorizontalAlign="Center" Width="15px" />
                        <ItemStyle HorizontalAlign="Center" Width="15px" />
                    </telerik:GridEditCommandColumn>
                    <telerik:GridButtonColumn 
                        ButtonType="ImageButton" 
                        CommandName="Delete" 
                        ConfirmDialogType="RadWindow" 
                        ConfirmText="ลบข้อมูลที่เลือก?" 
                        ItemStyle-Width="15" 
                        Text="คลิกเพื่อลบรายการ" 
                        UniqueName="column1">
                        <HeaderStyle HorizontalAlign="Center" Width="15px" />
                        <ItemStyle HorizontalAlign="Center" Width="15px"/>
                    </telerik:GridButtonColumn>
                    <telerik:GridBoundColumn 
                        DataField="EDU_INS_SEQ" 
                        DataType="System.Int32" 
                        Display="False" 
                        HeaderText="EDU_INS_SEQ" 
                        ReadOnly="True" 
                        UniqueName="EDU_INS_SEQ" 
                        visible="falSe">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn 
                        DataField="EDU_INS_CODE" 
                        FilterControlWidth = "100%"
                        AutoPostBackOnFilter ="true"
                        ShowFilterIcon ="false"
                        HeaderStyle-HorizontalAlign="Center" 
                        HeaderText="รหัส" 
                        UniqueName="EDU_INS_CODE">
                        <HeaderStyle HorizontalAlign="Center" Width="80px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn 
                        DataField="EDU_INS_NAME" 
                        FilterControlWidth = "100%"
                        AutoPostBackOnFilter ="true"
                        ShowFilterIcon ="false"
                        HeaderStyle-HorizontalAlign="Center" 
                        HeaderText="ชื่อสถาบันการศึกษา" 
                        UniqueName="EDU_INS_NAME">
                        <HeaderStyle HorizontalAlign="Center" Width="200px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn 
                        DataField="EDU_INS_ENG" 
                        FilterControlWidth = "100%"
                        AutoPostBackOnFilter ="true"
                        ShowFilterIcon ="false"
                        HeaderStyle-HorizontalAlign="Center" 
                        HeaderText="ชื่อสถาบันการศึกษา(อังกฤษ)" 
                        UniqueName="EDU_INS_ENG">
                        <HeaderStyle HorizontalAlign="Center" Width="100px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn 
                        DataField="EDU_GOV_NAME" 
                        FilterControlWidth = "100%"
                        AutoPostBackOnFilter ="true"
                        ShowFilterIcon ="false"
                        HeaderStyle-HorizontalAlign="Center" 
                        HeaderText="รัฐบาล/เอกชน" 
                        UniqueName="EDU_GOV_NAME">
                        <HeaderStyle HorizontalAlign="Center" Width="80px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn 
                        DataField="ADDRESS_FULL" 
                        FilterControlWidth = "100%"
                        AutoPostBackOnFilter ="true"
                        ShowFilterIcon ="false"
                        HeaderStyle-HorizontalAlign="Center" 
                        HeaderText="ที่อยู่" 
                        UniqueName="ADDRESS_FULL">
                        <HeaderStyle HorizontalAlign="Center" Width="100px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn 
                        DataField="COUNTRY_NAME" 
                        FilterControlWidth = "100%"
                        AutoPostBackOnFilter ="true"
                        ShowFilterIcon ="false"
                        HeaderStyle-HorizontalAlign="Center" 
                        HeaderText="ประเทศ" 
                        UniqueName="COUNTRY_NAME">
                        <HeaderStyle HorizontalAlign="Center" Width="100px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn 
                        DataField="TEL" 
                        FilterControlWidth = "100%"
                        AutoPostBackOnFilter ="true"
                        ShowFilterIcon ="false"
                        HeaderStyle-HorizontalAlign="Center" 
                        HeaderText="โทรศัพท์" 
                        UniqueName="TEL">
                        <HeaderStyle HorizontalAlign="Center" Width="100px" />
                    </telerik:GridBoundColumn>
                </Columns>
                <EditFormSettings                                     
                    EditFormType="WebUserControl" 
                    UserControlName="../UserControls/MAS_EduInstitutes.ascx">
                    <EditColumn UniqueName="EditCommandColumn1"></EditColumn>
                </EditFormSettings>
                <PagerStyle Mode="NextPrevNumericAndAdvanced" />
            </MasterTableView>
            <ClientSettings AllowColumnHide="True" 
                AllowColumnsReorder="True" 
                EnableRowHoverStyle="True" 
                ReorderColumnsOnClient="True">
                <Selecting AllowRowSelect="True" 
                EnableDragToSelectRows="true" />
                </ClientSettings>
        </telerik:RadGrid>
        </asp:Panel>
        </td>
        </tr>
        </table>
</div>
</td>
</tr>
</table>
                        
</asp:Content>
